<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div id="app">
        <component-father></component-father>
    </div>

    <template id="fTemplate">
        <div>
            <h1>This is father template</h1>
            <component-child component-name="001" @increase="changeTotal" @decrease="changeTotal"></component-child>
            <component-child @increase="changeTotal" @decrease="changeTotal"></component-child>
            <h4>This is totalCounter 👇</h4>
            <h5>{{totalCounter}}</h5>
        </div>
    </template>

    <template id="cTemplate">
        <div>
            <h2>This is children</h2>
            <!-- prop在用{{}}写法的时候应当用原来的名称，该大写大写，不用加横杠(-) -->
            <h3>name is {{componentName}}</h3>
            <button @click="increase">+</button>
            <button @click="decrease">-</button>
            <p>now my counter is {{counter}}</p>
        </div>
    </template>
    <script src="./vue.js"></script>
</body>
</html>